<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <title>未交易机台看板</title>
    <!--<link rel="stylesheet" href="../../Home/reset.css">-->
    <!--<link rel="stylesheet" href="../../Home/common.css">-->
    <link rel="stylesheet" href="../../library/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
    <link rel="stylesheet" href="../../css/common.css">
    <link rel="stylesheet" href="notTransaction.css">
    <script src="../../library/jquery/jquery-1.11.3.js"></script>
    <script src="../../library/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<!--机台名称-->
<div data-role="page" id="pageone" style="font-size:.12rem;">
    <div data-role="header" data-theme="a" data-position="fixed" class="header">
        <a href="index.html" target="_self" class="ui-btn ui-btn-b ui-icon-carat-l ui-btn-icon-notext" data-transition="slide" data-direction="reverse"><</a>
        <h2 style="font-size: 16px;">未交易机台看板</h2>
        <!--<a href="#pagetwo" target="_self" class="ui-btn ui-btn-b ui-icon-bars ui-btn-icon-notext" data-transition="slide" data-direction="reverse" style="padding-right: 14px;">条件筛选</a>-->
    </div>
    <div data-role="content">
        <ul data-role="listview" style="margin: 0;" class="list">

        </ul>
    </div>
</div>

<script src="../../library/vue/vue.js"></script>
<script src="../../library/vue/vue-resource.js"></script>
<!--<script src="monPrice.js"></script>-->
<script>
    $(document).ready(function() {
        //获取浏览器地址中的参数
        var url = window.location.href;
        var text=window.localStorage.getItem("text");
        console.log(text);
        var modelsend=decodeURI(getParamer('modelSend'));
        var provider=[];
        var machines_name=[];
        provider.push(text);
        var model=jQuery.parseJSON(modelsend);
        model.condition.provider = provider;
        model.condition.machines_name=machines_name;
        console.log(model);
        var IP = '39.107.58.193:8080';
        $.ajax({
            url: 'http://' + IP + '/data-center/recentBorad/getRecentBoardInfo?token=' + sessionStorage.getItem('userId'),
            type: "POST",
            data: {"paramData": JSON.stringify(model)},
            success: function (data) {
                console.log(data)
                var pointsData=data.pointsData;
                var str='';
                for (var i=0;i<pointsData.length;i++) {
                    str += '<li ><a id='+pointsData[i].id+' href="#" class="ui-btn ui-btn-icon-right ui-icon-carat-r">' + pointsData[i].label + '</a></li>';
                }
                $(".list").html(str)
            }
        });
        $('.list').on('click','li>a',function(){
            var text = $(this).attr('id');
            console.log(text);
            window.localStorage.setItem("text",text);
            location.href = 'detail.html?value='+JSON.stringify(model)+'';
        });

    });
    //方法获取浏览器的url中的参数
    function getParamer(paramer){
        var url=window.location.href.split("?")[1];
        if(url.indexOf("&")>0){
            urlParamArry=url.split("&");
            for(var i=0; i<urlParamArry.length; i++){
                var paramerName=urlParamArry[i].split("=");
                if(paramer==paramerName[0]){
                    return paramerName[1];
                }
            }
        }else{
            var paramerValue=url.split("=")[1];
            return paramerValue;
        }
    }
</script>
</body>
</html>